package com.xuelang.pipeline.infrastructure.task.converter;

import com.xuelang.pipeline.domain.task.Task;
import com.xuelang.pipeline.infrastructure.task.dataobject.TaskDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 流水线任务实体与流水线任务DO转换器类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface TaskToTaskDOConverter {

    TaskToTaskDOConverter INSTANCE = Mappers.getMapper(TaskToTaskDOConverter.class);

    /**
     * Task转化为TaskDO
     * @param task
     * @return
     */
    TaskDO taskToTaskDO(Task task);

    /**
     * TaskDO转化为Task
     * @param taskDO
     * @return
     */
    Task taskDOToTask(TaskDO taskDO);

}
